import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'

interface DataType {
    key: string;
    brand?: string;
    platform?: string;
    partition?: string;
    date: string;
    shop: string;
    Totalorderquantity: number;
    Settledorders: number;
    Unsubscribeorder: number;
    businesssales: number;
    Paidinamount: number;
    Deliveryfee: number;
    Platformsubsidies: number;
    servicecharge: number;
    children?: DataType[];
  }

@Schema()
export class Daily {
   @Prop({type:String})
   key: string;
   @Prop({type:String})
   brand?: string;
   @Prop({type:String})
   platform?: string;
   @Prop({type:String})
   partition?: string;
   @Prop({type:String})
   date: string;
   @Prop({type:String})
   shop: string;
   @Prop({type:Number})
   Totalorderquantity: number;
   @Prop({type:Number})
   Settledorders: number;
   @Prop({type:Number})
   Unsubscribeorder: number;
   @Prop({type:Number})
   businesssales: number;
   @Prop({type:Number})
   Paidinamount: number;
   @Prop({type:Number})
   Deliveryfee: number;
   @Prop({type:Number})
   Platformsubsidies: number;
   @Prop({type:Number})
   servicecharge: number;
   @Prop({type:Array<DataType>})
   children?: DataType[];
}
export const DailySchema = SchemaFactory.createForClass(Daily)